# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
maintainer="lauren n. liberda <lauren@selfisekai.rocks>"
pkgname=py3-rst2ansi
pkgver=0.1.5
pkgrel=0
pkgdesc="Rendering RST in the terminal"
url="https://github.com/Snaipe/python-rst2ansi"
arch="noarch"
license="MIT"
depends="py3-docutils"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
options="!check" # tests require https://pypi.org/project/cram/
subpackages="$pkgname-pyc $pkgname-doc"
source="https://github.com/Snaipe/python-rst2ansi/archive/v$pkgver/py3-rst2ansi-$pkgver.tar.gz"
builddir="$srcdir/python-rst2ansi-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm755 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
4ff47b58b8121fc72154dddb687b6e7d8aeda2ad2a00987a0598c3b33c44979aef8bfe8335d0c3f1f352eff9dcade533927bafd03e06c13193c80ba5fa874db0  py3-rst2ansi-0.1.5.tar.gz
"
